﻿Public Class BasicStatPanel

    Private Property Hero As heroObj
    Private Const RIGHT_TEXT_PAD_COUNT As Short = 15
    Private Const LEFT_TEXT_PAD_COUNT As Short = 15

    Public Sub New(ByVal heroIn As HeroObj)
        InitializeComponent()
        Me.Hero = heroIn
        RefreshStats()
    End Sub

    Public Sub RefreshStats()

        lblAttacks.Text = "Attacks:".PadRight(LEFT_TEXT_PAD_COUNT, " "c) + Me.Hero.Attacks.ToString()
        lblArmor.Text = "Armor:".PadRight(RIGHT_TEXT_PAD_COUNT, " "c) + Me.Hero.ArmorValue.ToString()
        lblClass.Text = AppConstants.TranslateHeroClassName(Me.Hero.HeroClassId)
        lblDamageDice.Text = "Damage:".PadRight(RIGHT_TEXT_PAD_COUNT, " "c) + Me.Hero.Damage.ToString()
        lblEndurance.Text = "Endurance:".PadRight(RIGHT_TEXT_PAD_COUNT, " "c) + Me.Hero.Endurance.ToString()
        lblGold.Text = "Gold:".PadRight(LEFT_TEXT_PAD_COUNT, " "c) + Me.Hero.Gold.ToString()
        lblHealth.Text = "Health:" + (Me.Hero.CurrentHealth.ToString + " / " + Me.Hero.MaxHealth.ToString).PadLeft(LEFT_TEXT_PAD_COUNT - 6)
        lblLevel.Text = "Level:".PadRight(RIGHT_TEXT_PAD_COUNT, " "c) + Me.Hero.Level.ToString()
        lblLuck.Text = "Luck:".PadRight(RIGHT_TEXT_PAD_COUNT, " "c) + Me.Hero.Luck.ToString()
        lblMeleeSkill.Text = "Melee Skill:".PadRight(LEFT_TEXT_PAD_COUNT, " "c) + Me.Hero.MeleeSkill.ToString()
        lblMove.Text = "Move:".PadRight(RIGHT_TEXT_PAD_COUNT, " "c) + Me.Hero.Move.ToString()
        lblName.Text = Me.Hero.Name

        lblPinning.Text = "Pinning:".PadRight(RIGHT_TEXT_PAD_COUNT - 1, " "c) + If(Me.Hero.Pinning > 0, Me.Hero.Pinning.ToString() + "+", " A")

        lblRangedSkill.Text = "Ranged Skill:".PadRight(RIGHT_TEXT_PAD_COUNT - 1, " "c) + Me.Hero.RangedSkill.ToString() + "+"
        lblStrength.Text = "Strength".PadRight(LEFT_TEXT_PAD_COUNT, " "c) + Me.Hero.Strength.ToString
        lblWit.Text = "Wit:".PadRight(LEFT_TEXT_PAD_COUNT, " "c) + Me.Hero.Wit.ToString

        If Me.Hero.HeroClassId = eHeroClass.Wizard Then
            Dim wizard As WizardObj = DirectCast(Me.Hero, WizardObj)
            lblPowerStore.Visible = True
            lblPowerStore.Text = "Power Store: " + wizard.PowerStore.ToString + " / " + wizard.MaxPowerStore.ToString()
        End If

    End Sub

End Class
